#include <iostream>
#include <string>
using namespace std;

int main() {
    string target; getline(cin, target);
    string result = "";
    for (int i = 0; i < target.size(); i++) {
        if (target[i] >= 'a' && target[i] <= 'z') {
            result.push_back((char)(target[i] - 32));
        }
        else if (target[i] >= 'A' && target[i] <= 'Z') {
            result.push_back((char)(target[i] + 32));
        }
        else {
            result.push_back(target[i]);
        }
    }
    cout << result;
    return 0;
}